function GMMObjective = GMM_objective_CD(params,data)

y_corr      = data(:,1);
v           = data(:,2);
k           = data(:,3);
Ly_corr     = data(:,4);
Lv          = data(:,5);
Lk          = data(:,6);  
L4v         = data(:,7);

productivity    = y_corr - params(1) * v - params(2) * k;
Lproductivity   = Ly_corr - params(1) * Lv - params(2) * Lk; 

[~, productivity_shock] = ols(productivity, Lproductivity);
 
aux = [L4v k].*productivity_shock;  
GMMObjective = length(aux)*mean(aux)*mean(aux)';    
    
end



 